﻿@using WebApp.Models
@using Telerik.Web.Mvc.UI

@model IEnumerable<REL_Ordine_Variante>

@{
    Layout = "_Layout.cshtml";
}

@{
    ViewBag.Title = "Tavoli : " + ViewBag.SET_Ordine.Tavoli + ". Elenco delle portate.";
}

@(Html.Telerik()
    .Grid(Model)
    .Name("ORD_CMD_GRID")
    .DataKeys(keys => keys.Add(c => c.Guid))
    .HtmlAttributes(new { @class = "data" })
    .Columns(columns =>
    {
        columns.Bound(o => o.ENT_Piatto.ENT_Gruppo.Nome).Sortable(true).Title("Categoria");
        columns.Bound(o => o.ENT_Piatto.Nome).Sortable(true).Title("Nome");
        columns.Bound(o => o.Prezzo).Title("Prezzo");
        columns.Template(o => @Html.ActionLink("Modifica", "ORD_CMD_EDT", new { f0 = ViewBag.SET_Ordine.Guid, f1 = o.Guid })).Width(80);
        columns.Template(o => @Html.ActionLink("Elimina", "FAM_PIA_LST", new { f0 = o.Guid })).Width(80);
    })
    .Editable(editing => editing.Mode(GridEditMode.PopUp))
    .DataBinding(dataBinding => dataBinding
    .Server()
    .Select("ORD_CMD", "Tavoli")))

@section submenu
{
    <tr>
        <td class="submenu_2" onclick="document.location.href='@Url.Action(MVC.Tavoli.ORD_CMD_SEL((String)ViewBag.SET_Ordine.Guid.ToString()))'">Aggiungi portata
        </td>
    </tr>
    <tr>
        <td class="submenu_2" onclick="document.location.href='@Url.Action(MVC.Tavoli.ORD_CMD((String)ViewBag.SET_Ordine.Guid.ToString()))'">Comande
        </td>
    </tr>
    <tr>
        <td class="submenu_2" onclick="document.location.href='@Url.Action(MVC.Tavoli.ORD_TAV((String)ViewBag.SET_Ordine.Guid.ToString()))'">Tavoli
        </td>
    </tr>
    <tr>
        <td class="submenu_2" onclick="document.location.href='@Url.Action("ORD_PAG", "Tavoli", new { f0 = ViewBag.SET_Ordine.Guid })'">Paga
        </td>
    </tr>
}
